package ukoly;

import java.util.GregorianCalendar;
import uzivatele.Uzivatel;

/**
 *
 * @author Jan Lukeš <lukesja7@fel.cvut.cz>
 * 
 */
public class Komentar {
    private String CommentText;
    private Uzivatel Author;
    private final int ID;
    private GregorianCalendar timeCreation;
    private UkolControl ukol;

    public Komentar(String CommentText, Uzivatel Author, int ID, GregorianCalendar timeCreation, UkolControl ukol) {
        this.CommentText = CommentText;
        this.Author = Author;
        this.ID = ID;
        this.timeCreation = timeCreation;
        this.ukol = ukol; 
    }
    
    public Uzivatel getAuthor() {
        return Author;
    }

    public String getCommentText() {
        return CommentText;
    }

    public int getID() {
        return this.ID;
    }

    public void setCommentText(String CommentText) {
        this.CommentText = CommentText;
    }

    public GregorianCalendar getTimeCreation() {
        return timeCreation;
    }

    public UkolControl getUkol() {
        return ukol;
    }

    
   @Override
    public String toString() {
        return CommentText;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Komentar other = (Komentar) obj;
        if ((this.CommentText == null) ? (other.CommentText != null) : !this.CommentText.equals(other.CommentText)) {
            return false;
        }
        if (this.ID != other.ID) {
            return false;
        }
        if (this.ukol != other.ukol && (this.ukol == null || !this.ukol.equals(other.ukol))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 41 * hash + (this.CommentText != null ? this.CommentText.hashCode() : 0);
        hash = 41 * hash + this.ID;
        hash = 41 * hash + (this.ukol != null ? this.ukol.hashCode() : 0);
        return hash;
    }


   
   
   
}
